#include <stdio.h>

int main()
{
    FILE* fp = fopen("log.txt","a");
    fputs("fouts\n",stdout);
    fwrite("fwrite\n",1,8,stdout);
    fprintf(stdout,"%s","fprintf\n");
    printf("\n");
    int i = 0;
    char buff[1024];
    while(i < 10)
    {
        snprintf(buff,sizeof(buff),"%d\n",i);
        fputs(buff,fp);
        i++;
    }
    fclose(fp);

    return 0;
}
